<?php
require_once('server.config.php');
define('SS_APP_PATH',realpath(dirname(__FILE__)));
set_include_path(
  dirname(__FILE__)
  . PATH_SEPARATOR . SS_ROOT_PATH
  . PATH_SEPARATOR . SS_ROOT_PATH.'/lib'
  . PATH_SEPARATOR . dirname(__FILE__).'/lib'
  . PATH_SEPARATOR . get_include_path());
require_once 'Bucket/bucket.inc.php';
//$bucket=new bucket_Container(new ss_factory($ss));
/*set_include_path(
  dirname(SS_ROOT_PATH)
  . PATH_SEPARATOR . SS_ROOT_PATH.'/lib'
  . PATH_SEPARATOR . get_include_path());*/
//require_once('D:\Work\SlipStream\slipstream\lib\FirePHPCore\FirePHP.class.php');
//require_once('D:\Work\SlipStream\slipstream\lib\FirePHPCore\fb.php');
require_once('FirePHPCore/FirePHP.class.php');
require_once('FirePHPCore/fb.php');
/*$ss=new ss_core_settings();
$ss->dao=(object) array(
		'default'=>(object)array(
			'type'=>'mysql',
			'host'=>'localhost',
			'user'=>'hamilton',
			'pass'=>'only4hamilton',
			'database'=>'hamilton',
			'conParam'=>array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,PDO::ERRMODE_EXCEPTION=>true)));
$ss->server=(object)array(
		'appath'=>(object)array(
			'category'=>'kategori',
			'entry'=>'artikel',
			'staff'=>'personal'));*/
$ss=(object) array(
	'error'=>(object)array(
		'firephp'=>(object)array(
			'active'=>true
		)
	),
	'dao'=>(object) array(
		'default'=>(object)array(
			'type'=>'mysql',
			'host'=>'localhost',
			'user'=>'hamilton',
			'pass'=>'only4hamilton',
			'database'=>'hamilton',
			'conParam'=>array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,PDO::ERRMODE_EXCEPTION=>true))),
	'server'=>(object)array(
		'appath'=>(object)array(
			'category'=>'kategori',
			'entry'=>'artikel',
			'staff'=>'personal')));
/*$ss['dao']['default']=array(
		'type'=>'mysql',
		'host'=>'localhost',
		'user'=>'hamilton',
		'pass'=>'only4hamilton',
		'database'=>'hamilton',
		'conParam'=>array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));
$ss_server=(object) array('appath'=>(object)array('category'=>'/category/'));*/
$firephp = FirePHP::getInstance(true);
$firephp->registerErrorHandler();
$firephp->registerExceptionHandler();
$firephp->registerExceptionHandler();
$options = array('maxObjectDepth' => 1,
                 'maxArrayDepth' => 4,
                 'useNativeJsonEncode' => true,
                 'includeLineNumbers' => true);
$firephp->setOptions($options);
//require_once('FirePHPCore/fb.php');
class ss_error extends FB {
}
FB::setEnabled(true);
//ss_error::setEnabled(SS_DEBUG);
ss_error::log('ss_error_core loaded. Logging initiated');

require_once(SS_ROOT_PATH.'/slipstream.config.php');
error_reporting(E_ALL | E_STRICT);

//var_dump(ini_get("include_path"));
require_once 'konstrukt/konstrukt.inc.php';
require_once 'konstrukt/response.inc.php';
require_once 'Smarty/Smarty.class.php';
require_once SS_APP_PATH . '/site.wiring.php';

date_default_timezone_set('Europe/Stockholm');
set_error_handler('k_exceptions_error_handler');
spl_autoload_register('k_autoload');